package chapter01.h1_1;

public class Main {
    public static void main(String[] args) {
        BookShelf bookShelf = new BookShelf(4);
        bookShelf.appendBook(new Book("111"));
        bookShelf.appendBook(new Book("222"));
        bookShelf.appendBook(new Book("333"));
        bookShelf.appendBook(new Book("444"));
        bookShelf.appendBook(new Book("555"));
        bookShelf.appendBook(new Book("666"));
        bookShelf.appendBook(new Book("777"));
        bookShelf.appendBook(new Book("888"));
        Iterator iterator = bookShelf.iterator();
        while (iterator.hasNext()){
            Book book = (Book) iterator.next();
            System.out.println(book.getName());
        }

    }
}
